import {notification} from "ant-design-vue";

export default {
    mounted(el, bindling) {
        el.addEventListener('click', () => {
            const text = bindling.value || el.textContent;
            navigator.clipboard.writeText(text).then(() => {
                notification.success({
                    message: '复制成功',
                    duration:1.5
                })
            }).catch(err=>{
                notification.warning({
                    message: '复制失败',
                    duration:1.5
                })
            })
        })
    }
}
